#pragma once

#include "Containers/Any.h"

#include "Containers/Vector.h"

class CGSharpFieldProperty;

class CGSharpFieldValuesContainer
{   
public:    
    CGSharpFieldValuesContainer(
        TVector<CGSharpFieldProperty*> InFields
        ,uint32_t InStartFieldIndex
        );

    ~CGSharpFieldValuesContainer();

   // void * GetValuePtr(uint32_t Index);
    void SetValue(uint32_t Index, CAny && InValue);

    void SetValue(uint32_t Index, const CAny& InValue);

    const CAny& GetValue(uint32_t Index) const;
    
    //Get address of field value
    void* GetValuePointer(uint32_t Index) const;

    //reset all value to default
    void ResetValues();
protected:
    TVector<CGSharpFieldProperty*>  Fields;

    TVector<CAny>  Values;

    //the index of the first field in this container
    uint32_t StartFieldIndex=0;
};